home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
001
/
pibt40s1.arc
/
INITCOMM.MOD
< prev
next >
Wrap
Text File
|
1987-09-04
|
5KB
|
128 lines
(*----------------------------------------------------------------------*)
(* Initialize_Communications --- Initialize communications *)
(*----------------------------------------------------------------------*)
PROCEDURE Initialize_Communications;
(*----------------------------------------------------------------------*)
(* *)
(* Procedure: Initialize_Communications *)
(* *)
(* Purpose: Initializes serial port and modem *)
(* *)
(* Calling Sequence: *)
(* *)
(* Initialize_Communications *)
(* *)
(*----------------------------------------------------------------------*)
VAR
F : FILE;
Text_F : TEXT;
Do_Scr : BOOLEAN;
Line : AnyStr;
Ierr : INTEGER;
BEGIN (* Initialize_Communications *)
(* Initialize error handler. *)
ErrorPtr := OFS( Trap_Error );
(* Get serial port initialized *)
IF ( NOT Set_Params( TRUE , FALSE ) ) THEN
BEGIN
WRITELN('*** Sorry, can''t initialize communications.');
WRITELN('*** Program stops.');
Halt( 1 );
END;
(* Give Program Notice *)
Scroll( 1, Max_Screen_Line, 1, Max_Screen_Col, 0,
Global_ForeGround_Color, Global_BackGround_Color );
MoveToXY( 1 , 1 );
WRITELN('PibTerm Version ', PibTerm_Version);
WRITELN(PibTerm_Date);
WRITELN('Copyright (c) 1985, 1986, 1987 by Philip R. Burns.');
WRITELN('Hit Alt-I for command list.');
(* Indicate if debug mode on *)
IF Debug_Mode THEN
WRITELN('*** Debug mode on ***');
(* Initialize Modem *)
Initialize_Modem;
(* Initialize Printer *)
IF ( LENGTH( Printer_Setup ) > 0 ) THEN
WRITE( LST, Printer_Setup );
(* Pick up script file name if any, *)
(* and convert to executable form. *)
IF ( Command_Script_File_Name <> '' ) THEN
BEGIN
Do_Scr := FALSE;
IF ( POS( '\' , Command_Script_File_Name ) = 0 ) AND
( POS( ':' , Command_Script_File_Name ) = 0 ) THEN
Script_File_Name := Script_Path + Command_Script_File_Name
ELSE
Script_File_Name := Command_Script_File_Name;
ASSIGN( F , Script_File_Name );
(*$I-*)
RESET( F );
(*$I+*)
IF ( Int24Result = 0 ) THEN
BEGIN
(*$I-*)
CLOSE( F );
(*$I+*)
Do_Scr := TRUE;
END
ELSE
BEGIN
(*$I-*)
CLOSE( F );
Ierr := Int24Result;
ASSIGN( Text_F , Script_Path + 'PIBTERM.SCL' );
RESET ( Text_F );
(*$I+*)
IF ( Int24Result = 0 ) THEN
BEGIN
READLN( Text_F , Line );
Line := Line + ' ';
Do_Scr := ( UpperCase( Substr( Line, 1, 10 ) ) = '==PIBTERM ' );
END;
(*$I-*)
CLOSE( Text_F );
Ierr := Int24Result;
(*$I+*)
END;
IF Do_Scr THEN
IF MyLoadOverlay( 0 , PT4SCRI, 'PT4SCRI.CHN' ) THEN
Process_Script( Script_File_Name , 'E' );
END;
{
IF Debug_Mode THEN
IF TimeSharingActive THEN
BEGIN
WRITELN;
WRITE('Multitasker: ');
CASE MultiTasker OF
DoubleDos: WRITELN('DoubleDos');
DesqView: WRITELN('DesqView');
TopView: WRITELN('TopView');
TaskView: WRITELN('TaskView');
ELSE WRITELN('Other');
END (* CASE *);
END;
}
END (* Initialize_Communications *);